<template>
    <div class="mask">
        <div :class=" type == 'index' ? 'mask-main' : ''">
            <mask-index v-if="type == 'index'" @close="close"></mask-index>

            <mask-file v-if="type == 'file'" @close="close"></mask-file>
        </div>
        
    </div>
</template>

<script>
import maskIndex from './components/index.vue';
import maskFile from './components/file.vue';

export default {
    mixins: [],
    components: {
        maskIndex,
        maskFile
    },
    props: {
        finish: {
            type: [Function,Boolean],
            default: false
        },
        type: {
            type: String,
            default: "index"
        }
    },
    provide() {
        return {
            
        };
    },
    data() {
        return {
            
        };
    },
    computed: {
        
    },
    methods: {
        close(){
            !!this.finish && this.finish()
        }
    },
    mounted() {
        
    },
}
</script>

<style lang="scss" scoped>
@import '@css/var.scss';
    .mask{
        position: fixed;
        top: 0;
        width: 100%;
        height: 100%;
        background-color: rgb(14, 1, 1);
        opacity: 0.3;
        z-index: 1000;

        &>div {
            width: 100%;
            height: 100%;
        }

        .mask-main {
            margin: 0 auto;
            width: 1200px;
            height: 100%;
        }
    }
</style>